import React, { memo } from "react";

const Index = ({ config }) => {
	const { text } = config.props;

	const getDivStyle = props => {
		// console.log(config);
		const style = {
			overflow: "hidden",
			...props,
			width: props.w + "px" ?? "100%",
			height: props.h + "px" ?? "100%",
			color: props.fontColor,
			textAlign: props.fontAlign,
			opacity: props.opacity / 100
		};
		return style;
	};

	return (
		<>
			<div style={getDivStyle(config.props)}>{text}</div>
		</>
	);
};

export default memo(Index);
